< previous page page_657 next page >

Page 657
analysis.gifBy centering the control where the mouse is, it looks a little better since the control wont jump around the screen as much.
For a completed example of this, you can look at the sample file Drag1.frm, as shown in Figure 32.2.
Examples Filename: Drag1.frm
8160-0657a.gif
Figure 32.2
The first example of drag and drop.

Changing the Drag Icon
Most applications have a nice icon that displays when you start dragging a particular control or data. Just by setting the DragIcon property, you can add this functionality to your drag-and-drop operation.
EXERCISE
Add a DragIcon
1. Go back to design mode on the form.
2. Click the label control one time to give it focus.
3. In the Properties window for the label control, double-click the DragIcon property.
4. Locate the Bullseye.ico file in the folder for this chapter. Click the OK button on the Open dialog box to set this property.
5. Run the application again and see what happens when you start to drag the label around the form.
analysis.gifIt is nice to give the user a good visual clue that the control is now moving by setting the DragIcon property.

 
< previous page page_657 next page >

If you like this book, buy it!